package com.yugao.fintech.libra.common.util.number;

import org.springframework.util.Assert;

import java.math.BigDecimal;
import java.math.RoundingMode;

public class BigDecimalUtils {

    public static BigDecimal divide(BigDecimal left, BigDecimal right) {
        Assert.notNull(left, "left must not be null");
        Assert.notNull(right, "right must not be null");
        return left.divide(right, 2, RoundingMode.DOWN);
    }
}
